// 打乱数组顺序
export const upset = function (arr) {
  let len = arr.length
  for (let i = 0; i < len; i++) {
    let currentIndex = Math.floor(Math.random() * len)
    let temp = arr[i]
    arr[i] = arr[currentIndex]
    arr[currentIndex] = temp
  }
}

// 随机截取数组
export const cutOut = function (arr, num) {
  while (arr.length > num) {
    let currentIndex = Math.floor(Math.random() * arr.length)
    arr.splice(currentIndex, 1)
  }
}